﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Service.Contracts.Runtime.GetProductFeedback
{

	/// <summary>
	/// Data contract representing a product review for a single product by a single customer.
	/// </summary>
	[DataContract(Name = "ProductReview", Namespace = "http://schemas.jtleigh.com/Commerce/Spencer/Features/ProductFeedback/1.0/Runtime/GetProductFeedback/")]
	public class ProductReview
	{

		#region Properties

		/// <summary>
		/// Gets or sets the title of the review.
		/// </summary>
		[DataMember(Name = "Title", IsRequired = false)]
		public string Title { get; set; }

		/// <summary>
		/// Gets or sets the body of the review.
		/// </summary>
		[DataMember(Name = "Body", IsRequired = true)]
		public string Body { get; set; }

		/// <summary>
		/// Gets or sets the list of review attribute values.
		/// </summary>
		/// <value>An <see cref="IList{TItem}"/> of <see cref="ProductReviewAttributeValue"/>.</value>
		[DataMember(Name = "AttributeValues", IsRequired = true)]
		public IList<ProductReviewAttributeValue> AttributeValues { get; set; }

        /// <summary>
        /// Gets or sets the list of images relevant to this review.
        /// </summary>
        /// <value>An <see cref="IDictionary{TKey,TValue}"/> of <see cref="ProductReviewImage"/> 
        /// keyed by image identifier <see cref="Guid"/>.</value>
        [DataMember(Name = "Images", IsRequired = true)]
        public IList<ProductReviewImage> Images { get; set; }

        /// <summary>
        /// Gets or sets the video relevant to this review.
        /// </summary>
        /// <value>An <see cref="ProductReviewVideo"/> object, or <see langword="null"/> if the 
        /// review does not have a video.</value>
        [DataMember(Name = "Video", IsRequired = true)]
        public ProductReviewVideo Video { get; set; }

        /// <summary>
		/// Gets or sets the total number of third party reviews of this review.
		/// </summary>
		[DataMember(Name = "TotalThirdPartyReviews", IsRequired = true)]
		public int TotalThirdPartyReviews { get; set; }

		/// <summary>
		/// Gets or sets the number of third party reviews of this review that were positive.
		/// </summary>
		[DataMember(Name = "PositiveThirdPartyReviews", IsRequired = true)]
		public int PositiveThirdPartyReviews { get; set; }

		#endregion // Properties

	}

}
